package cn.zucc.edu.madq.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.zucc.edu.madq.dao.UserMapper;
import cn.zucc.edu.madq.pojo.User;
import cn.zucc.edu.madq.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {
	@Resource
	private UserMapper userMapper;

	@Override
	public User getUserById(int id) {
		return userMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<User> getAllUser() {
		return userMapper.selectAll();
	}

	@Override
	public int updateUser(User user) {
		return userMapper.updateByPrimaryKeySelective(user);
	}

	@Override
	public int insertUser(User user) {
		return userMapper.insertSelective(user);
	}

}
